# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-isc_dhcp_leases
pkgname=('python2-isc_dhcp_leases' 'python-isc_dhcp_leases')
_pkgname=isc_dhcp_leases
pkgver=0.10.0
pkgrel=3
pkgdesc='Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server.'
arch=('any')
license=('MIT')
url='https://pypi.org/project/isc_dhcp_leases/'
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6c103ad74fb3bd6254887beeac00dc572a17b43330982edac9d072d2afa22724493a4ed206ab66c4ddbfa4d4d4c8f20a74131d77ddb29e5ad19656a822caf905')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-isc_dhcp_leases() {
  depends=('python2' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
}

package_python-isc_dhcp_leases() {
  depends=('python' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}

